import QtQuick

import "../as_qml"

Window {
    id: root
    width: 520
    height: 360
    visible: true
    title: qsTr("使用说明")

    property color mTextColor: "#1a1c1e"

    Rectangle {
        anchors.fill: parent
        color: "#d2d4d6"

        AsText {
            anchors.left: aboutText.left
            anchors.bottom: aboutText.top
            anchors.bottomMargin: 10
            text: qsTr("OpenCV Teach Tool")
            font.pixelSize: 17
            font.bold: true
        }

        Column {
            id: aboutText
            anchors.centerIn: parent
            spacing: 10

            Repeater {
                model: ["Current version 1.0",
                        "Based on Qt 6.4.0 MSVC 2019 64bit",
                        "Built on 2023/5/5 23:45",
                        "Author is @woshiashuai"]

                delegate: AsText {
                    width: 260
                    text: modelData
                    color: mTextColor
                    font.pixelSize: 13
                }
            }
        }

        MouseArea{
            anchors.top: aboutText.bottom
            anchors.topMargin: 10
            anchors.left: aboutText.left
            width: linkText.width
            height: linkText.height
            hoverEnabled: true
            cursorShape: containsMouse ? (pressed ? Qt.ClosedHandCursor : Qt.OpenHandCursor) : Qt.ArrowCursor

            AsText {
                id: linkText
                text: "<a href='https://gitee.com/woshiashuai/qt6-windows-opencv-teach-tool.git'>Open the project source code from Gitee</a>"
                anchors.centerIn: parent
                color: mTextColor
                font.pixelSize: 13
                onLinkActivated: Qt.openUrlExternally("https://gitee.com/woshiashuai/qt6-windows-opencv-teach-tool.git")
            }
        }
    }
}
